package Project.SendRedMoney;

import java.util.ArrayList;

public class MainRedPacket {
    public static void main(String[] args) {
        //首先要有群主
        Manager manager = new Manager("群主", 100);

        Member member1 = new Member("成员A",0);
        Member member2 = new Member("成员B",0);
        Member member3 = new Member("成员C",0);

        //显示群主有多少钱
        manager.show();
        //下面显示成员ABC各有多少钱
        member1.show();
        member2.show();
        member3.show();
        System.out.println("===================================");

        //Manager类中send方法的集合从哪来？
        //下面表示群主发20元，分三份
        ArrayList<Integer> redList = manager.send(20,3 );

        member1.receive(redList);
        member2.receive(redList);
        member3.receive(redList);

        //显示群主发完红包后还剩多少钱
        manager.show();
        //下面显示成员ABC收红包后有多少钱
        //这里成员是随机获取红包集合中元素的索引下标，所以各成员获取红包金额随机
        member1.show();
        member2.show();
        member3.show();

    }
}
